public class nbvr {
    public int length(String ss){
        char[] s = ss.toCharArray();
        int[] hash =new int[128];
        int left = 0,right = 0,n  = ss.length();
        int ret = 0;
        while(right<n){
            hash[s[right]]++;
            while(hash[s[right]]>1){
                hash[s[left++]]--;
                ret = Math.max(ret,right-left+1);
                right++;
            }
        }
        return ret;
    }
}
